<template>
  <Back />
  <div class="body">
    <div class="font-size-1.8rem">{{ t('agent.address') }}</div>
    <div class="m-t-30px">
      <div>地址 陕西省西安市莲湖区丰庆路景寓学府西区二号楼TEAWOO{{ userNo }}室</div>
      <div>收件人 潘潘</div>
      <div>电话 13720582336</div>
    </div>
    <div class="text-center m-t-40px">
      <van-button block round color="#3AA1A2" @click="copy">
        {{ $t('agent.copy') }}
      </van-button>
    </div>

    <div class="text-center m-t-80px">
      <van-button block round color="#3AA1A2" @click="cs">
        {{ $t('agent.cs') }}
      </van-button>
    </div>
  </div>
</template>

<script setup lang="ts">
const route = useRoute()
const userNo = route.query.userNo

const link = `地址 陕西省西安市莲湖区丰庆路景寓学府西区二号楼TEAWOO${userNo}室
收件人 潘潘
电话 13720582336`

const { t } = useI18n()

const copy = async () => {
  try {
    await navigator.clipboard.writeText(link)
    showToast(t('invite.invite.copyOk'))
  } catch (err) {
    showToast(t('invite.invite.copyFail'))
  }
}

function cs() {
  location.href = 'https://t.me/Teawoo_uz_support'
}
</script>

<style lang="scss" scoped>
.body {
  overflow: hidden;
  width: 100%;
  min-height: 100vh;
  background-color: #f6f6f6;
  box-sizing: border-box;
  padding: 14px;
  font-size: 1.4rem;
}
</style>
